package com.example.back.service.impl;

import com.example.back.model.TCollection;
import com.example.back.service.TCollectionService;
import com.example.back.mapper.TCollectionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author jialily
* @description 针对表【t_collection】的数据库操作Service实现
* @createDate 2022-05-10 14:06:35
*/
@Service("tCollectionService")
@Transactional(propagation = Propagation.SUPPORTS,rollbackFor = Exception.class)
public class TCollectionServiceImpl implements TCollectionService{

    @Autowired
    TCollectionMapper tCollectionMapper;

    @Override
    public List<TCollection> selectCollection(String username) {
        return this.tCollectionMapper.selectCollection(username);
    }

    @Override
    public int insertCollection(String username, String food, String areaname) {
        return this.tCollectionMapper.insertCollection(username, food, areaname);
    }
}
